@echo off

set DOCKER_HOST=http://192.168.1.15:2375

set INSTALL_PATH=%~dp0

echo INSTALL_PATH:%INSTALL_PATH%

call :install_base

call :install_all

call :build_consumer

cd %INSTALL_PATH%

call :build_loader

cd %INSTALL_PATH%

call :build_monitor

cd %INSTALL_PATH%

exit /b

:install_base
(
    cd  ../mqbd
    set "METHOD_NAME=%~n0_method"
    mvn   clean install   -Dskipprods -P prod
    cd %INSTALL_PATH%
)
 
:install_all
(
    set "METHOD_NAME=%~n0_method"
    mvn   clean install   -Dskipprods -P prod
   
)

:build_consumer
(
   set "METHOD_NAME=%~n0_method"
   echo %METHOD_NAME%
   cd ./mqbd-consumer
   mvn   clean install  -Dskipprods -P prod  com.spotify:dockerfile-maven-plugin:1.4.13:build  com.spotify:dockerfile-maven-plugin:1.4.13:push

)

:build_loader
(
   set "METHOD_NAME=%~n0_method"
   echo %METHOD_NAME%
   cd ./mqbd-loader
   mvn   clean install  -Dskipprods -P prod  com.spotify:dockerfile-maven-plugin:1.4.13:build  com.spotify:dockerfile-maven-plugin:1.4.13:push

)

:build_monitor
(
   set "METHOD_NAME=%~n0_method"
   echo %METHOD_NAME%
   cd ./mqbd-monitor
   mvn   clean install  -Dskipprods -P prod  com.spotify:dockerfile-maven-plugin:1.4.13:build  com.spotify:dockerfile-maven-plugin:1.4.13:push

)


